package com.xiaocz.hblsubstitutedriving.interfaces;

/**
 * Time:2019/8/6
 * Created by xiaocz
 * Describe 触发刷新工具
 */
public class CancelUtils {

    private static RoundRefresh mOrderCancelRefresh,mPayReFresh,mWxPaySuccess;


    /**
     * 客户取消订单
     */
    public static void setCancelRefresh(RoundRefresh orderCancelRefresh){
        mOrderCancelRefresh = orderCancelRefresh;
    }

    public static void clear(){
        mOrderCancelRefresh=null;
    }

    public static void onCancelRefresh(int type,String message){
        if(mOrderCancelRefresh !=null){
            mOrderCancelRefresh.onRoundRefresh(type,message);
        }
    }

    /**
     * 收到客户微信付款
     */
    public static void setPayRefresh(RoundRefresh roundRefresh){
        mPayReFresh = roundRefresh;
    }

    public static void clearPay(){
        mPayReFresh=null;
    }

    public static RoundRefresh onPayRefresh(int type,String message){
        if(mPayReFresh !=null){
            mPayReFresh.onRoundRefresh(type,message);
        }
        return mPayReFresh;
    }

    /**
     * 微信支付成功
     */
    public static void setWxPayRefresh(RoundRefresh wxPaySuccess){
        mWxPaySuccess = wxPaySuccess;
    }

    public static void clearWxPay(){
        mWxPaySuccess=null;
    }

    public static RoundRefresh onWxPayRefresh(int type,String message){
        if(mWxPaySuccess !=null){
            mWxPaySuccess.onRoundRefresh(type,message);
        }
        return mWxPaySuccess;
    }
}
